package com.funny.learning.english.model;

import java.io.Serializable;

import org.json.JSONObject;

public class LanguageEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// hl: "ja",
	// iid: 2,
	// level1: 11,
	// level2: 111,
	// level3: 1111,
	// name: "Japan",
	// slug: "japan",
	// url: "54bf88fb78a23c4f4b8b4569.jpg",
	// vname: "Tiếng Nhật",
	// id: "546c08edf62ac4a8272a4692"

	private String hl;
	private int iid;
	private int level1;
	private int level2;
	private int level3;
	private String name;
	private String slug;
	private String url;
	private String vname;
	private String id;
	private boolean isCheck;

	public LanguageEntity(JSONObject jsonObject) {
		hl = jsonObject.optString("hl", "");
		iid = jsonObject.optInt("iid", 0);
		level1 = jsonObject.optInt("level1", 0);
		level2 = jsonObject.optInt("level2", 0);
		level3 = jsonObject.optInt("level3", 0);
		name = jsonObject.optString("name", "");
		slug = jsonObject.optString("slug", "");
		url = jsonObject.optString("url", "");
		vname = jsonObject.optString("vname", "");
		id = jsonObject.optString("id", "");
	}

	public LanguageEntity() {

	}

	public LanguageEntity(String hl, int iid, int level1, int level2,
			int level3, String name, String slug, String url, String vname,
			String id) {
		super();
		this.hl = hl;
		this.iid = iid;
		this.level1 = level1;
		this.level2 = level2;
		this.level3 = level3;
		this.name = name;
		this.slug = slug;
		this.url = url;
		this.vname = vname;
		this.id = id;
	}

	public String getHl() {
		return hl;
	}

	public void setHl(String hl) {
		this.hl = hl;
	}

	public int getIid() {
		return iid;
	}

	public void setIid(int iid) {
		this.iid = iid;
	}

	public int getLevel1() {
		return level1;
	}

	public void setLevel1(int level1) {
		this.level1 = level1;
	}

	public int getLevel2() {
		return level2;
	}

	public void setLevel2(int level2) {
		this.level2 = level2;
	}

	public int getLevel3() {
		return level3;
	}

	public void setLevel3(int level3) {
		this.level3 = level3;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSlug() {
		return slug;
	}

	public void setSlug(String slug) {
		this.slug = slug;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getVname() {
		return vname;
	}

	public void setVname(String vname) {
		this.vname = vname;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	

	public boolean isCheck() {
		return isCheck;
	}

	public void setCheck(boolean isCheck) {
		this.isCheck = isCheck;
	}

	@Override
	public String toString() {
		return "LanguageEntity [hl=" + hl + ", iid=" + iid + ", level1="
				+ level1 + ", level2=" + level2 + ", level3=" + level3
				+ ", name=" + name + ", slug=" + slug + ", url=" + url
				+ ", vname=" + vname + ", id=" + id + "]";
	}

}
